<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
    </el-breadcrumb>
    <el-divider></el-divider>
    <el-carousel height="300px">
      <el-carousel-item v-for="item in arr" :key="item">
        <img :src="item" alt="轮播图" width="100%" height="100%"/>
      </el-carousel-item>
    </el-carousel>

    <el-divider></el-divider>

    <div style="height: 30px"></div>
    <div>
      <el-row :gutter="0">
        <el-col :span="16"><div class="grid-content bg-purple">
          <div>
            <h2>公告信息</h2>
            <el-divider></el-divider>
            <div v-for="p in info">
              <h3>{{p.title}}</h3>
              <span>{{p.description}}</span>
              <el-divider></el-divider>
            </div>
          </div>

        </div></el-col>
        <el-col :span="8"><div class="grid-content bg-purple">
          <h2>组件工具</h2>
          <el-empty description="描述文字"></el-empty>
        </div></el-col>
      </el-row>
    </div>

  </div>

</template>
<style >
.banner{
  border-top: solid 3px #003E7D;background-color:#E7E8EB;
}
element.style{
  padding: 0px !important;
}
</style>
<script>
export default {
  data() {
    return{
      activeIndex: '1',
      activeIndex2: '1',
      arr: ['/images/banner1.jpg', '/images/banner2.jpg'],
      input: '',
      info:'',
      activeNames: ['1']
    }
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },

    loadInfoList() {
      let url = "http://120.77.154.166:8080/examIntroduction/list";
      console.log('url = ' + url);

      this.axios
          .create({'headers': {'Authorization': localStorage.getItem('jwt')}})
          .get(url).then((response) => {
        let jsonResult = response.data;
        if (jsonResult.state == 20000) {
          console.log(jsonResult.data)
          this.info = jsonResult.data;
        }
      });
    }
  },
  mounted() {
    this.loadInfoList();
  }
}
</script>

